
<div ng-controller="MortgageCtrl">
	
<div ng-include="'/templates/paramsSelect.html'"></div>
	<div class="page-heading">
		<ul class="breadcrumb">
			<li><a href="javascript:;">报表管理</a></li>
			<li >衍生业务</li>
			<li class="active" ng-hide="menuName">按揭统计</li>
			<li class="active" ng-show="menuName" ng-bind="menuName"></li>
			<span style="margin-right:10px;"  class="btn btn-danger btn-xs pull-right btn-flag " ng-show="flag" ng-click="delFlag('/mortgage/mortgage/')"><i class="fa fa-times"></i> 删除 </span>
			<span style="margin-right:10px;"  class="btn btn-info btn-xs pull-right btn-flag " ng-click="addFlag('#/mortgage/mortgage/')"><i class="fa fa-star"></i> 收藏 </span>
		
		</ul>
	</div>
	<!-- 页面头部  end-->

	<!--页面内容显示区域-->
	<div class="wrapper">


		<div class="row">
			<div class="col-sm-12">
				<!--表格显示区域-->
				<section class="panel">
					<!--区块头 显示表格名称和功能按钮-->
					<header class="panel-heading">
						按揭信息列表
						<!--控制按钮-->
						<span class="tools pull-right"> <!--收起-->
							<button type="button" class="btn btn-success pull-left" ng-click="SearchData()"
								style="margin-left: 5px;">
								<i class="fa fa-search"></i> 查询
							</button>
							<button type="button" class="btn btn-info  pull-left" ng-click="ExportData()"
								style="margin-left: 5px;">
								<i class="fa fa-table"></i> 导出EXCEL
							</button> <a href="javascript:;" class="fa fa-chevron-up form_display"></a>

						</span>
					</header>
					<!--区块body 显示表格内容-->
					<div class="panel-body form-horizontal form_hide">
						<div class="row">
							<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">事业部</label>
										<div class="col-lg-8 col-sm-7">
										<input type="text" id="entity_group_name"  name="entity_group_name"  ng-keyup="clearGroup()" class="form-control select_edit form_params" />
                                            <ul class="select_list">
                                                  <li ng-repeat="e in groups" ng-click='LoadBrands(e.group_name)' val_code="{{e.group_name}}" val_name="{{e.group_name}}">{{e.group_name}}</li>
                                            </ul>  
                                            </div>
								</div>
							</div>
							
							<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">店面品牌</label>
									<div class="col-lg-8 col-sm-7">
										<input type="text" id="entity_brand_name"  name="entity_brand_name" ng-keyup="clearGroupBrand()" class="form-control select_edit form_params" value=""/>
                                            <ul class="select_list">
                                                  <li ng-repeat="e in gBrands" ng-click='LoadEntitys(e)' val_code="{{e.brand_code}}" val_name="{{e.brand_name}}">{{e.brand_name}}</li>
                                            </ul> 
									</div>
								</div>
							</div>
							
							
							<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label" for="inputEmail1">店面信息</label>
									<div class="col-lg-8 col-sm-7">
											<input type="text" id="entity_name" name="entity_name" class="form-control select_edit form_params" value=""/>
                                            <ul class="select_list">
                                                  <li ng-repeat="e in entitys" val_code="{{e.entity_code}}" val_name="{{e.entity_name}}">{{e.entity_name}}({{e.entity_code}})</li>
                                            </ul>  
									</div>
								</div>
							</div>
							
							<!-- VIN -->
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">VIN</label>
									<div class="col-lg-8 col-sm-7">
										<input name="vin" class="form-control form_params" />
									</div>
								</div>
							</div>
							<!-- 结案日期 -->
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label" for="inputEmail1">结案日期</label>
									<div class="col-lg-8 col-sm-7">
										<div data-date-format="yyyy-mm-dd" data-date="2016-5-15" class="input-large custom-date-range">
											<input type="text" name="close_time1" class="form-control form_params" id="close_time1"
												onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'close_time2\')||\'2020-10-01\'}'})">
										</div>
									</div>
								</div>
							</div>
                            <div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label text-center" for="inputEmail1">至</label>
									<div class="col-lg-8 col-sm-7">
										<div data-date-format="yyyy-mm-dd" data-date="2016-5-15" class="input-large custom-date-range">
											<input type="text" name="close_time2" class="form-control form_params" id="close_time2"
												onFocus="WdatePicker({minDate:'#F{$dp.$D(\'close_time1\')}',maxDate:'2020-10-01'})">
										</div>
									</div>
								</div>
							</div>
                            

							
							<!-- 车牌号 -->
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">车牌号</label>
									<div class="col-lg-8 col-sm-7">
										<input name="license" class="form-control form_params" />
									</div>
								</div>
							</div>
							
						 <!-- 按揭单号 -->
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">按揭单号</label>
									<div class="col-lg-8 col-sm-7">
										<input name="loan_no" class="form-control form_params" />
									</div>
								</div>
							</div>
							 
                            
                            <!-- 开单日期 -->
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label" for="inputEmail1">开单日期</label>
									<div class="col-lg-8 col-sm-7">
										<div data-date-format="yyyy-mm-dd" data-date="2016-5-15" class="input-large custom-date-range">
											<input type="text" name="sheet_create_date1" class="form-control form_params" id="sheet_create_date1"
												onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'sheet_create_date2\')||\'2020-10-01\'}'})">
											 
										</div>
									</div>
								</div>
							</div>
                            <div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label text-center" for="inputEmail1">至</label>
									<div class="col-lg-8 col-sm-7">
										<div data-date-format="yyyy-mm-dd" data-date="2016-5-15" class="input-large custom-date-range">
											 <input type="text"  name="sheet_create_date2" class="form-control form_params" id="sheet_create_date2"
												onFocus="WdatePicker({minDate:'#F{$dp.$D(\'sheet_create_date1\')}',maxDate:'2020-10-01'})">
										</div>
									</div>
								</div>
							</div>
                            
							
							<!-- 客户编号 -->
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">客户编号</label>
									<div class="col-lg-8 col-sm-7">
										<input name="customer_no" class="form-control form_params" />
									</div>
								</div>
							</div>

							<!-- 客户名称 -->
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">客户名称</label>
									<div class="col-lg-8 col-sm-7">
										<input name="customer_name" class="form-control form_params" />
									</div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">机构类型</label>
									<div class="col-lg-8 col-sm-7">
										<select name="mechanism_type" class="form-control form_params">
											<option></option>
											<option ng-selected="b.status_code==selected.mechanism_type" ng-repeat="b in mechanism_types" value="{{b.status_desc}}">{{b.status_desc}}</option>
										</select>
									</div>
								</div>
							</div>
							<div class="col-md-3">
								
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label" for="inputEmail1">金融机构</label>
									<div class="col-lg-8 col-sm-7">
											<input type="text" name="financial_institution" class="form-control select_edit form_params" value=""/>
                                            <ul class="select_list">
                                                  <li ng-repeat="e in financial_institutions" val_code="{{e.financial_institution_name}}" val_name="{{e.financial_institution_name}}">{{e.financial_institution_name}}</li>
                                            </ul>  
									</div>
								
								</div>
							</div>
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">贷款方式</label>
									<div class="col-lg-8 col-sm-7">
										<select name="loan_type" class="form-control form_params">
											<option></option>
											<option ng-selected="b.status_code==selected.loan_type" ng-repeat="b in loan_types" value="{{b.status_desc}}">{{b.status_desc}}</option>
										</select>
									</div>
								</div>
							</div>
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">是否抵押</label>
									<div class="col-lg-8 col-sm-7">
										<select name="is_mortgage" class="form-control form_params">
											<option></option>
											<option ng-selected="selected.is_mortgage=='12781001'" value="12781001">是</option>
											<option ng-selected="selected.is_mortgage=='0'" value="0">否</option>
										</select>
									</div>
								</div>
							</div>
							
							<!-- 开单人 -->
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">开单人</label>
									<div class="col-lg-8 col-sm-7">
										<input name="sheet_created_by" class="form-control form_params" />
									</div>
								</div>
							</div>
						</div>
					</div>
				</section>

				<section class="panel">
					<!--区块头 显示表格名称和功能按钮-->
					<header class="panel-heading">
						按揭信息列表
						<headshow></headshow>
						<div class="option_check_list" style="display: inline-block;"></div>

						<!--控制按钮-->
						<span class="tools pull-right"> <!--收起--> <a
							href="javascript:;" class="fa fa-chevron-down"></a>
						</span>
						<div class="pull-right"
							style="margin-right: 10px; margin-top: -6px; display: inline-block">
							<button type="button" class="btn btn-danger btn-sm " href="#paramsSelect"
								data-toggle="modal">
								<i class="fa fa-plus"></i> 在结果集中筛选
							</button>
							<button type="button" class="btn btn-success btn-sm"
								id="search_table" ng-click="SearchData();">
								<i class="fa fa-search"></i> 查询表格
							</button>
						</div>
					</header>
					<!--区块body 显示表格内容-->
					<div class="panel-body form-horizontal ">

						<div class="adv-table" style="overflow-x: scroll">
							<table id="cotyTable"
								class="table table-striped  nowrap  dataTable no-footer table_store table-hover float_head"
								cellspacing="0" width="100%">
								<thead>
									<tr>
										<th ng-show="!cols.contains('index_id')" column="index_id">序号</th>
										<th ng-show="!cols.contains('entity_code')" column="entity_code">店面编号</th>
										<th ng-show="!cols.contains('entity_name')" column="entity_name">店面名称</th>
										<th ng-show="!cols.contains('entity_brand_name')" column="entity_brand_name">店面品牌</th>
										<th ng-show="!cols.contains('entity_group_name')" column="entity_group_name">事业部</th>
										<th ng-show="!cols.contains('loan_no')" column="loan_no">按揭单号</th>
										<th ng-show="!cols.contains('customer_no')" column="customer_no">客户编号</th>
										<th ng-show="!cols.contains('customer_name')" column="customer_name">客户名称</th>
										<th ng-show="!cols.contains('sheet_created_by')" column="sheet_created_by">开单人</th>
										<th ng-show="!cols.contains('sold_by')" column="sold_by">销售顾问</th>
										<th qtype='date' ng-show="!cols.contains('sheet_create_date')" column="sheet_create_date">开单日期</th>
										<th qtype='date' ng-show="!cols.contains('close_time')" column="close_time">结案日期</th>
										<th ng-show="!cols.contains('vin')" column="vin">VIN</th>
										<th ng-show="!cols.contains('license')" column="license">车牌号</th>
										<th ng-show="!cols.contains('financial_institution')" column="financial_institution">金融机构</th>
										<th ng-show="!cols.contains('mechanism_type')" column="mechanism_type">机构类型</th>
										<th ng-show="!cols.contains('loan_type')" column="loan_type">贷款方式</th>
										<th qtype='long' ng-show="!cols.contains('loan_time_limit')" column="loan_time_limit">贷款期限</th>
										<th qtype='float' ng-show="!cols.contains('first_pay_amount')" column="first_pay_amount">首付款</th>
										<th qtype='float' ng-show="!cols.contains('loan_amount')" column="loan_amount">贷款金额</th>
										<th qtype='float' ng-show="!cols.contains('oem_discount')" column="oem_discount">主机厂贴息</th>
										<th qtype='float' ng-show="!cols.contains('group_discount')" column="group_discount">集团贴息</th>
										<th qtype='float' ng-show="!cols.contains('owner_discount')" column="owner_discount">自付利息</th>
										<th qtype='float' ng-show="!cols.contains('service_charge')" column="service_charge">服务费</th>
										<th qtype='float' ng-show="!cols.contains('premium')" column="premium">担保费</th>
										<th qtype='float' ng-show="!cols.contains('period_premium')" column="period_premium">期间担保费</th>
										<th qtype='float' ng-show="!cols.contains('points')" column="points">代办手续费</th>
										<th qtype='float' ng-show="!cols.contains('notarial_fees')" column="notarial_fees">公证费</th>
										<th qtype='float' ng-show="!cols.contains('reins_deposit')" column="reins_deposit">续保押金</th>
										<th qtype='float' ng-show="!cols.contains('mortgage_fees')" column="mortgage_fees">抵押费</th>
										<th qtype="bool" ng-show="!cols.contains('is_mortgage')" column="is_mortgage">是否抵押</th>
										<th qtype="bool" ng-show="!cols.contains('is_lend')" column="is_lend">是否放贷</th>
										<th qtype='float' ng-show="!cols.contains('receiveable_amount')" column="receiveable_amount">应收金额</th>
										<th qtype='float' ng-show="!cols.contains('no_tax_receiveable_amount')" column="no_tax_receiveable_amount">实际收入(不含税)</th>
										<th ng-show="!cols.contains('series_name')" column="series_name">车系</th>
										<th ng-show="!cols.contains('model_name')" column="model_name">车型</th>
										<th ng-show="!cols.contains('config_name')" column="config_name">配置</th>
									</tr>
								</thead>
								<tbody>
									<tr ng-repeat="c in mortgages">
										<td  ng-show="!cols.contains('index_id')" class="">{{$index + 1 }}</td>
										<td ng-show="!cols.contains('entity_code')" column="entity_code">{{c.entity_code}}</td>
										<td ng-show="!cols.contains('entity_name')" column="entity_name">{{c.entity_name}}</td>
										<td ng-show="!cols.contains('entity_brand_name')" column="entity_brand_name">{{c.entity_brand_name}}</td>
										<td ng-show="!cols.contains('entity_group_name')" column="entity_group_name">{{c.entity_group_name}}</td>
										<td  ng-show="!cols.contains('loan_no')" class="">{{c.loan_no}}</td>
										<td  ng-show="!cols.contains('customer_no')" class="">{{c.customer_no}}</td>
										<td  ng-show="!cols.contains('customer_name')" class="">{{c.customer_name}}</td>
										<td  ng-show="!cols.contains('sheet_created_by')" class="">{{c.sheet_created_by}}</td>
										<td  ng-show="!cols.contains('sold_by')" class="">{{c.sold_by}}</td>
										<td  ng-show="!cols.contains('sheet_create_date')" class="">{{c.sheet_create_date}}</td>
										<td  ng-show="!cols.contains('close_time')" class="">{{c.close_time}}</td>
										<td  ng-show="!cols.contains('vin')" class="">{{c.vin}}</td>
										<td  ng-show="!cols.contains('license')" class="">{{c.license}}</td>
										<td  ng-show="!cols.contains('financial_institution')" class="">{{c.financial_institution}}</td>
										<td  ng-show="!cols.contains('mechanism_type')" class="">{{c.mechanism_type}}</td>
										<td  ng-show="!cols.contains('loan_type')" class="">{{c.loan_type}}</td>
										<td  ng-show="!cols.contains('loan_time_limit')" class="">{{c.loan_time_limit}}</td>
										<td  ng-show="!cols.contains('first_pay_amount')" class="right">{{c.first_pay_amount |number:2}}</td>
										<td  ng-show="!cols.contains('loan_amount')" class="right">{{c.loan_amount |number:2}}</td>
										<td  ng-show="!cols.contains('oem_discount')" class="right">{{c.oem_discount |number:2}}</td>
										<td  ng-show="!cols.contains('group_discount')" class="right">{{c.group_discount |number:2}}</td>
										<td  ng-show="!cols.contains('owner_discount')" class="right">{{c.owner_discount |number:2}}</td>
										<td  ng-show="!cols.contains('service_charge')" class="right">{{c.service_charge |number:2}}</td>
										<td  ng-show="!cols.contains('premium')" class="right">{{c.premium |number:2}}</td>
										<td  ng-show="!cols.contains('period_premium')" class="right">{{c.period_premium |number:2}}</td>
										<td  ng-show="!cols.contains('points')" class="right">{{c.points |number:2}}</td>
										<td  ng-show="!cols.contains('notarial_fees')" class="right">{{c.notarial_fees |number:2}}</td>
										<td  ng-show="!cols.contains('reins_deposit')" class="right">{{c.reins_deposit |number:2}}</td>
										<td  ng-show="!cols.contains('mortgage_fees')" class="right">{{c.mortgage_fees |number:2}}</td>
										<td  ng-show="!cols.contains('is_mortgage')" class="">{{c.is_mortgage=='12781001'?'是':'否'}}</td>
										<td  ng-show="!cols.contains('is_lend')" class="">{{c.is_lend=='12781001'?'是':'否'}}</td>
										<td  ng-show="!cols.contains('receiveable_amount')" class="right">{{c.receiveable_amount |number:2}}</td>
										<td  ng-show="!cols.contains('no_tax_receiveable_amount')" class="right">{{c.no_tax_receiveable_amount==null?0.00:c.no_tax_receiveable_amount |number:2}}</td>
										<td  ng-show="!cols.contains('series_name')" class="">{{c.series_name}}</td>
										<td  ng-show="!cols.contains('model_name')" class="">{{c.model_name}}</td>
										<td  ng-show="!cols.contains('config_name')" class="">{{c.config_name}}</td>
									</tr>
									
									<tr class="tbody_last_tr" ng-if="pagination.totalItems > 0">
										<td  ng-show="!cols.contains('index_id')" class=""></td>
										<td ng-show="!cols.contains('entity_code')" column="entity_code"></td>
										<td ng-show="!cols.contains('entity_name')" column="entity_name"></td>
										<td ng-show="!cols.contains('entity_brand_name')" column="entity_brand_name"></td>
										<td ng-show="!cols.contains('entity_group_name')" column="entity_group_name"></td>
										<td  ng-show="!cols.contains('loan_no')" class=""></td>
										<td  ng-show="!cols.contains('customer_no')" class=""></td>
										<td  ng-show="!cols.contains('customer_name')" class=""></td>
										<td  ng-show="!cols.contains('sheet_created_by')" class=""></td>
										<td  ng-show="!cols.contains('sold_by')" class=""></td>
										<td  ng-show="!cols.contains('sheet_create_date')" class=""></td>
										<td  ng-show="!cols.contains('close_time')" class=""></td>
										<td  ng-show="!cols.contains('vin')" class=""></td>
										<td  ng-show="!cols.contains('license')" class=""></td>
										<td  ng-show="!cols.contains('financial_institution')" class=""></td>
										<td  ng-show="!cols.contains('mechanism_type')" class=""></td>
										<td  ng-show="!cols.contains('loan_type')" class=""></td>
										<td  ng-show="!cols.contains('loan_time_limit')" class=""></td>
										<td  ng-show="!cols.contains('first_pay_amount')" class="right">{{sumData.sum_first_pay_amount.value |number:2}}</td>
										<td  ng-show="!cols.contains('loan_amount')" class="right">{{sumData.sum_loan_amount.value |number:2}}</td>
										<td  ng-show="!cols.contains('oem_discount')" class="right">{{sumData.sum_oem_discount.value |number:2}}</td>
										<td  ng-show="!cols.contains('group_discount')" class="right">{{sumData.sum_group_discount.value |number:2}}</td>
										<td  ng-show="!cols.contains('owner_discount')" class="right">{{sumData.sum_owner_discount.value |number:2}}</td>
										<td  ng-show="!cols.contains('service_charge')" class="right">{{sumData.sum_service_charge.value |number:2}}</td>
										<td  ng-show="!cols.contains('premium')" class="right">{{sumData.sum_premium.value |number:2}}</td>
										<td  ng-show="!cols.contains('period_premium')" class="right">{{sumData.sum_period_premium.value |number:2}}</td>
										<td  ng-show="!cols.contains('points')" class="right">{{sumData.sum_points.value |number:2}}</td>
										<td  ng-show="!cols.contains('notarial_fees')" class="right">{{sumData.sum_notarial_fees.value |number:2}}</td>
										<td  ng-show="!cols.contains('reins_deposit')" class="right">{{sumData.sum_reins_deposit.value |number:2}}</td>
										<td  ng-show="!cols.contains('mortgage_fees')" class="right">{{sumData.sum_mortgage_fees.value |number:2}}</td>
										<td  ng-show="!cols.contains('is_mortgage')" class=""></td>
										<td  ng-show="!cols.contains('is_lend')" class=""></td>
										<td  ng-show="!cols.contains('receiveable_amount')" class="right">{{sumData.sum_receiveable_amount.value |number:2}}</td>
										<td  ng-show="!cols.contains('no_tax_receiveable_amount')" class="right">{{sumData.sum_no_tax_receiveable_amount.value |number:2}}</td>
										<td  ng-show="!cols.contains('series_name')" class=""></td>
										<td  ng-show="!cols.contains('model_name')" class=""></td>
										<td  ng-show="!cols.contains('config_name')" class=""></td>
									</tr>
								</tbody>
							</table>
							<div class="no-items" ng-show="pagination.totalItems <= 0">暂无数据</div>
						</div>
						<tm-pagination conf="pagination"></tm-pagination>
					</div>
				</section>
				<!--表格显示区域-->

			</div>
		</div>
	</div>
	 
</div>

<form id="export_form" action="mortgage/export"  method="post">
	<input type="hidden" name="keys" id="keys" />
	<input type="hidden" name="names" id="names" /> 
	<input type="hidden" name="params" id="params" />
	<input type="hidden" name="search_opt" id="search_opt" /> 
	<input type="hidden" name="file_name" id="file_name" value="按揭统计"/>
</form>